﻿using System;
using System.Text;

namespace Smart.Web.Mobile
{
    /// <summary>
    /// 
    /// </summary>
    public class MobileUTF8Encoding : MobileEncoding
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="pictgramTreat"></param>
        public MobileUTF8Encoding(PictgramTreat pictgramTreat) :
            base( Encoding.UTF8, pictgramTreat )
        {
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="chars"></param>
        /// <param name="charIndex"></param>
        /// <param name="charCount"></param>
        /// <param name="bytes"></param>
        /// <param name="byteIndex"></param>
        /// <returns></returns>
        protected override int GetMobileBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex)
        {
            return BaseEncoding.GetBytes( chars, charIndex, charCount, bytes, byteIndex );
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="bytes"></param>
        /// <param name="byteIndex"></param>
        /// <param name="byteCount"></param>
        /// <param name="chars"></param>
        /// <param name="charIndex"></param>
        /// <returns></returns>
        protected override int GetMobileChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex)
        {
            return BaseEncoding.GetChars( bytes, byteIndex, byteCount, chars, charIndex );
        }
    }
}
